# 需求 :


# 图书馆    名字   有书 books[]
# 卖书
# 购书
# 在图书馆里读书 (谁在 图书馆 读书)
# 借书
# 还书
class Library:
    def __init__(self, name, books, messages):  # books  书
        self.name = name
        self.books = books
        self.messages = messages

    def salebook(self, book):
        pass

    def buybook(self, book):
        pass

    def lendbook(self, student, book):
        pass

    def receivebook(self, student, book):
        pass

    def receive_message(self, msg):
        self.messages.append(msg)


class Book:
    def __init__(self, name, author, price, count):
        self.name = name
        self.author = author
        self.price = price
        self.count = count


# 书   bookname author price 数量


# 给学生用
#   功能,学生能干啥
# 查询图书    查所有()  查询某类数据 (booktype)  根据书名 (bookname)
# 借书
# 还书
# 意见反馈
class Student:
    def __init__(self, name, books):
        self.name = name
        self.books = books

    def query_book(self, lib, tofind_book_name):
        for book in lib.books:
            if book.name == tofind_book_name:
                return book

    def borrow_book(self, lib, book):
        # lib.books.
        pass

    def giveback_book(self, lib, book):
        pass

    def advise(self, lib, msg):
        lib.receive_message(msg)
